"""
发送图片客户端
"""
from socket import *

ADDR = ("127.0.0.1",8888)

def send_image(sock,image):
    fr = open(image, "rb")
    # 边读取边发送
    while True:
        data = fr.read(1024)
        if not data:
            break
        sock.send(data)


def main():
    sock = socket()
    sock.connect(ADDR)
    #调用发送图片函数
    send_image(sock,"01.jpg")